{template 'common/header'}
<div class="page superpage_{$do}" id="superpage_{$do}_{$act}">
	<div class="content">
		<!--head-->
		<div id="hd" style="{if isset($creditmall_list)}height:12rem;{else}height: 11rem;{/if} background: url({if $this->setting['base']['topimg']}{php echo tomedia($this->setting['base']['topimg'])}{else}{$user['big_avatar']}{/if})  no-repeat center;background-size: cover;">
			<div id="drag" class="drag"></div>
			<div class="row">
				<div class="col-50 integral_wrap">
					<span class="my_integral">我的{$credit_title}</span>
					<span class="my_integral_num">{$user['credit']}</span>
				</div>
				<div class="col-50 rule_wrap">
					{if $this->setting['base']['sign_rule'] != ''}
					<a href="#" class="sign_rule">签到规则</a>
					{/if}
				</div>
			</div>
			<div class="sign_btn_wrap">
				{if isset($sign_log['today_rank'])}
				<div class="my_integral_info">
					<div class="row no-gutter">
						<div class="col-25">
							<img src="{php echo tomedia($user['avatar'])}" alt="" onerror="this.src='resource/images/heading.jpg'"/>
						</div>
						<div class="col-75">
							<span>已连续签到<span class="highlight">{$sign_log['continue_total']}</span>天，累计签到<span class="highlight">{$sign_log['total']}</span>天</span>
							{if $beat_percent == 100 }
							<span>你击败了<span class="highlight">99%</span>的用户，继续加油吧</span>
							{else}
							<span>你击败了<span class="highlight">{$beat_percent}%</span>的用户，继续加油吧</span>
							{/if}
						</div>
					</div>
				</div>
				{else}
				<form method="post" action="{$_W['siteurl']}">
					<input type="hidden" name="token" value="{$_W['token']}">
					<a href="#" class="btn_3d btn_3d_up external">点击签到</a>
				</form>
				{/if}
			</div>

			{if isset($creditmall_list)}
			<div class="exchange_info">
				<div class="row no-gutter">
					<div id="creditmall_order" class="col-75">
						{loop $creditmall_list $item}
						<li>
							{$item['nickname']} 花费{if $item['price']>0}{$item['credit']}{$item['credit_title']}+{$item['price']}元{else}{$item['credit']}{$item['credit_title']}{/if} 兑换{php echo trim($item['title'])}
						</li>
						{/loop}
					</div>
					<div class="col-25">
						<a class="external" href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=home&m=superman_creditmall">
							去兑换<span class="icon icon-right"></span>
						</a>
					</div>
				</div>
			</div>
			{/if}
		</div>
		<!--body-->
		<div id="bd">
			<div class="rank_wrap">
				<div class="buttons-tab">
					<a href="{php echo $this->createMobileUrl('sign', array('rid'=>$this->rid, 'rank'=>'today', '__from' => $_GPC['__from']))}" class="rank_link {if $rank_type=='today'}active{/if} button external">今日排行榜</a>
					<a href="{php echo $this->createMobileUrl('sign', array('rid'=>$this->rid, 'rank'=>'all', '__from' => $_GPC['__from']))}" class="rank_link {if $rank_type=='all'}active{/if} button external">总排行榜</a>
					<a href="{php echo $this->createMobileUrl('sign', array('rid'=>$this->rid, 'rank'=>'credit', '__from' => $_GPC['__from']))}" class="rank_link {if $rank_type=='credit'}active{/if} button external">积分排行榜</a>
				</div>
				<div class="rank_list_wrap">
					<div class="tabs">
						<div class="tab active">
							<div class="list-block">
								<div class="list-group">
									<ul>
										<li>
											<div class="item-content">
												<div class="item-inner {if $rank_type=='today'}column4{else}column3{/if}">
													<div class="item-title">排名</div>
													<div class="item-title">昵称</div>
													{if $rank_type=='today'}
													<div class="item-title">奖励</div>
													<div class="item-title">签到时间</div>
													{else if $rank_type=='all'}
													<div class="item-title">签到总天数</div>
													{else if $rank_type=='credit'}
													<div class="item-title">{$credit_title}</div>
													{/if}
												</div>
											</div>
										</li>
										{if $list}
										{loop $list $li}
										<li>
											<div class="item-content">
												<div class="item-inner {if $rank_type=='today'}column4{else}column3{/if}">
													<div class="item_ranking">
														<span class="rank{$li['index']}">{$li['index']}</span>
													</div>
													<div class="item-title">
														<img src="{php echo tomedia($li['avatar']);}" onerror="this.src='resource/images/heading.jpg'" class="sign_avatar">
														{if $li['nickname']!=''}
														{$li['nickname']}
														{else}
														{$li['uid']}
														{/if}
													</div>
													{if $rank_type=='today'}
													<div class="item-title">{$li['reward']}</div>
													<div class="item-title">{$li['time']}</div>
													{else if $rank_type=='all'}
													<div class="item-title">{$li['total']}</div>
													{else if $rank_type=='credit'}
													<div class="item-title">{$li['credit']}</div>
													{/if}
												</div>
											</div>
										</li>
										{/loop}
										{/if}
									</ul>
									{if !$list}
									<p style="text-align: center;color: #ccc; font-size: .7rem;">还没有数据，快去抢签到~~~</p>
									{/if}
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	{if isset($_GPC['__from']) && in_array($_GPC['__from'], array('superman_creditmall','superman_mall'))}
	<div class="sign_back">
		{if $_GPC['__from'] == 'superman_creditmall'}
		<a class="external" href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=task&type=2&m=superman_creditmall"><span class="icon icon-home"></span></a>
		{else if $_GPC['__from'] == 'superman_mall'}
		<a class="external" href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=home&m=superman_mall"><span class="icon icon-home"></span></a>
		{/if}
	</div>
	{/if}
	<!--<div class="invite_btn_wrap">
		<a href="javascript:void(0);" class="button button-fill button-warning button-big">
			<span class="icon icon-share"></span>
			点击邀请好友
		</a>
	</div>-->
</div>
{if $this->setting['base']['sign_rule'] != ''}
<div class="popup sign_popup">
	<div class="content-block">
		<i class="iconfont close-popup">&#xe600;</i>
		{php echo htmlspecialchars_decode($this->setting['base']['sign_rule']);}
	</div>
</div>
{/if}
{template 'common/footer'}